package com.esfak47.mediafetcher.app.event.eventhandler;

import com.esfak47.mediafetcher.core.event.Event;
import com.esfak47.mediafetcher.core.event.EventGroupEnum;
import com.esfak47.mediafetcher.core.event.EventHandler;

import java.util.Set;

/**
 * @author tony
 * @date 2018/5/21
 */
public abstract class AbstractEventHandler implements EventHandler {
    private final Set<String> supportSubject;
    private final Set<EventGroupEnum> supportGroup;

    protected AbstractEventHandler(Set<String> supportSubject,
                                   Set<EventGroupEnum> supportGroup) {
        this.supportSubject = supportSubject;
        this.supportGroup = supportGroup;
    }

    @Override
    public Set<EventGroupEnum> getSupportGroup() {
        return this.supportGroup;
    }

    @Override
    public Set<String> supportSubject() {
        return this.supportSubject;
    }

    @Override
    public boolean supportAllSubject() {
        return false;
    }

    @Override
    public abstract void onEvent(Event event);
}
